# Contributor: knuxify <knuxify@gmail.com>
# Contributor: Maxim Karasev <begs@disroot.org>
# Maintainer: knuxify <knuxify@gmail.com>
pkgname=chafa
pkgver=1.12.3
pkgrel=0
pkgdesc="Terminal graphics for the 21st century"
url="https://hpjansson.org/chafa"
arch="all"
license="LGPL-3.0-or-later"
makedepends="glib-dev freetype-dev libjpeg-turbo-dev tiff-dev libwebp-dev"
subpackages="$pkgname-libs $pkgname-dev $pkgname-doc"
source="https://github.com/hpjansson/chafa/releases/download/$pkgver/chafa-$pkgver.tar.xz"

# librsvg depends on rust, which is not available on that arches currently
case "$CARCH" in
	riscv64|s390x) ;;
	*) makedepends="$makedepends librsvg-dev";;
esac

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-gtk-doc \
		--without-imagemagick
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
00d186aa3e5a184b5fe985909118fe856c7889e6674d55de6fe409f04ccac0a8698ef8063a2049e8b100ea0e9abfa5f89c959333a18cd6f934608b86f256ee5d  chafa-1.12.3.tar.xz
"
